Add assembler function for noise filter. Minor code fixes.