Fix missing return value and default switch case