Bugfixes?

Signed-off-by: Norman Cao <maplenormandy@gmail.com>