Fxied #610 and fixed #613