Fixed crash and removed warning.