Code cleanup: fixed the model matrix bug

Still not sure how I did that...