Relative imports plus few more fixes

See the commits.