Fix dimension handeling