Fixes some exceptions for null pointer access and list to array conversions