Fixed #477, Fixed #607, Fixed #604, Fixed #610