Fixed #24 and fixed #30