fixed warnings and fatal errors