bug fixes and loc