various fix #27, fix #30, fix #34