Fixed some sonar issues, fixed invalid working directory test. Fixes #145