Fixed #412 and Fixed #416