Merge changes of OSPy back to OSPi

This pull request should be used if you want to take over the changes I've made in the OSPy master.