fixed warnings and errors