fixed warnings and minor problems