Fix #145, fix #147