Fix warnings and remove unnecessary #ifdefs