Fix #17, Fix #18, Fix #19