First fix for #30
Final fix for #30