change some critical RuntimeException to Error; minor fixes