Bug fix and test refactor
Bug fixes and unit tests for raspi