Bugfixes for OSR

- Adds initial check and provides error message (gets rid of cryptic error messages in OSR)
- Takes care of unaccounted errors from resol in osr_obj
- Adds function headers