Fixed issues 383 and 387