Fixed #1 and fixed #3