Fixed the bug and added the test.
Added max_pool check as well.
Merge pull request #813 from caglar/fix_conv_nonlin

Fixed the bug for nonlinearity and added the test.