Improve type-guessing from default values

Fix broken regex for type-guessing bools, and make type-guessing of bools and arrays case insensitive.