Fixed bug with scalar treatment