Small bugfixes, includes fix for null values