Fixing warnings and more stuff needed to port