Fix #48, #47, #46