Fixed #324 and Fixed #459