Fixed #34 and fixed #24