Tidy up naming and dependencies.
Check for defined package before declaring it.
Merge branch 'release/1.0.2'