Added possibility to specify pidFilename, small fixes

- Can now specify pidFilename, according changes overall in code
- Small fixes based on feedback received