openssd: cleanup of code and add some bug_on's