fixed package declarations
further support for logical locs
merged and took ashims version