Fixed #30, fixed #27