Fixed issues #14-17