Fixed rayleigh test and testing function

Hope everything works now
Could you remove the whitespace at the end of the line? It is not crucial, but definitely nicer.