fixed #281 and added test case

--HG--
branch : trunk
2 files changed