Fixed issues 611 and 622.