fixed warnings, minor bug fixes