Fixed determinant, bug fixes.