schema.c: Check for errors and save default schema

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>