Bug fixes in extended variable code