Fix GetCenter function in case, that element not found