Linux fix: Added include of cmath and reorganized includes