Fixed exceptions hadling and and default values assignments.