bug fixes on #14