Fix some bugs, add better debugging
parameterize package version