minor fixes and cleanup in shells and libs