Bug fixes and added lodash