New functions for parsing - more robust.