Fix #31, Fix #45, Fix #37