Cleaned up fix for #1