More robust fixes for #1, thanks again pinpickle