Fixed #217 and fixed #218