Merged in changes from lpd