Fixed #241 and fixed #254