 Not really sure what causes this and it may be hard to debug. At least add an error message for the user.