Refactored fix for #80 and #84 to provide Maven 2 support
This should fix #77 as well