Fixed issues #371, #372