Fixing orientation detection bug.