Fixed problem with subtracting mean