Corrected implementation of default values.
Added some comments.