general cleanup, use new err(3) routines