Little fixes.
Some error-checking.
Some error-checking.