Fixed the last few issues - scanf issues for doubles, error cases, return values.