Bugfix #16

Minor adjustments to bug fix of the maskPattern method. This bug was mentioned on issue #16