Fix bugs in case with begin. Add if-else block sample code