Should fix #1024 #994 #1015