Integration of @alexec changes

@alexec: Thanks!