Fix #15 and fix #16