Merging fixes from @eyscode.