Added rudimentary workaround when matrix is singular

Also moved warning supression to __main__.py