Fixed problems regarding orientation and offset