bug fixes in typedef