Fix NP1 number of patterns

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
Minor code cleanup

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>