Loads of small fixes. float -> double for data format.