Fix warnings and specific errors