Fixed build errors

Fixed build errors and warnings