Fixed issues: #590, #904