Fixes to shift direction for maps and small amount of code tidying